import java.util.ArrayList;
import java.util.List;
public class HallConfig {
    public static List<Hall> initHalls() {
        List<Hall> halls = new ArrayList<>();
        halls.add(new Hall("黄金厅", 8, 10));
        halls.add(new Hall("白银厅", 10, 12));
        halls.add(new Hall("翡翠厅", 7, 8));
        halls.add(new Hall("钻石厅", 7, 8));
        halls.add(new Hall("宝石厅", 8, 9));
        return halls;
    }
    public static Hall getHallByName(List<Hall> hallList, String hallName) {
        for (Hall hall : hallList) {
            if (hall.getHallName().equals(hallName)) {
                return hall;
            }
        }
        return null;
    }
    public static boolean updateHallSeats(List<Hall> hallList, String hallName, int newRows, int newSeatsPerRow) {
        Hall hall = getHallByName(hallList, hallName);
        if (hall == null) {
            return false;
        }
        hall.setTotalRows(newRows);
        hall.setSeatsPerRow(newSeatsPerRow);
        hall.resetSeats();
        return true;
    }
}